/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.fb.common;

/**
 *
 * @author Administrator
 */
public class NewsData {

    String id;
    String title;
    String slug;
    String desc;
    String content;
    long time;
    String author;
    String editor;
    long updated;
    long created;
    int status;
    String source;
    String image;

    // contructor for add new
    public NewsData(String title, String slug, String desc, String content, long time, String author, int status, String source, String image) {

        this.title = title;
        this.slug = slug.equalsIgnoreCase("") ? CommonUtil.URLFriendly(title) : slug;
        this.desc = desc;
        this.content = content;
        this.time = time;
        this.author = author;
        this.editor = author;
        this.updated = System.currentTimeMillis();
        this.created = System.currentTimeMillis();
        this.status = status;
        this.source = source;
        this.image = image;
    }

    // contructor for edit
    public NewsData(String id, String title, String slug, String desc, long time,
            String content, String editor, int status, String source, String image) {

        this.id = id;
        this.title = title;
        this.slug = slug.equalsIgnoreCase("") ? CommonUtil.URLFriendly(title) : slug;
        this.desc = desc;
        this.content = content;
        this.time = time;
        this.editor = editor;
        this.updated = System.currentTimeMillis();
        this.status = status;
        this.source = source;
        this.image = image;
    }

    public NewsData(String id, String title, String slug, String desc, String content,
            String author, String editor, long updated, long created, int status, long time, String source, String image) {

        this.id = id;
        this.title = title;
        this.slug = slug.equalsIgnoreCase("") ? CommonUtil.URLFriendly(title) : slug;
        this.desc = desc;
        this.content = content;
        this.time = time;
        this.author = author;
        this.editor = editor;
        this.updated = updated;
        this.created = created;
        this.status = status;
        this.source = source;
        this.image = image;
    }

    public String getId() {
        return id != null ? id : "";
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title != null ? title : "";
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSlug() {
        return slug != null ? slug : "";
    }

    public void setSlug(String slug) {
        this.slug = slug;
    }

    public String getDesc() {
        return desc != null ? desc : "";
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getContent() {
        return content != null ? content : "";
    }

    public void setContent(String content) {
        this.content = content;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public String getAuthor() {
        return author != null ? author : "";
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getEditor() {
        return editor != null ? editor : "";
    }

    public void setEditor(String editor) {
        this.editor = editor;
    }

    public long getUpdated() {
        return updated;
    }

    public void setUpdated(long updated) {
        this.updated = updated;
    }

    public long getCreated() {
        return created;
    }

    public void setCreated(long created) {
        this.created = created;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getSource() {
        return source != null ? source : "";
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getImage() {
        return image != null ? image : "";
    }

    public void setImage(String image) {
        this.image = image;
    }

}
